package org.groovymud.scripting.domain;

import java.util.List;

public interface DomainManager<T> {

	/**
	 * gets a list of handles defined by the domain manager. 
	 * @return
	 */
	public List<String> getHandles();

	/**
	 * indicates whether this domain manager can load the domain identifier
	 * @param domain
	 * @return
	 */
	public boolean canLoad(String domain);

	/**
	 * loads domain(s) specified by a string.
	 * 
	 * Implementations may load one or more domain definitions
	 * 
	 * @param domain - a string representing the definition of the domain
	 */
	public void loadDomain(String domain);

	/**
	 * removes an object from the manager, requiring the manager
	 * to reload the definition next time cloneObject is called
	 * @param handle
	 */
	public void removeObject(String handle);

	/**
	 * creates a copy of the object with the handle specified. 
	 * 
	 * returns null if it cannot load or find the object
	 * @param handle
	 * @return
	 */
	public T getObject(String handle);

	/**
	 * Whether or not the domain manager currently contains the object with the specified handle
	 * @param handle the name of the object
	 * @return
	 */
	public boolean contains(String handle);

    public void preLoadDomains();
}
